package com.help10000.rms.ui.dialog

import android.content.Context
import com.amir.common.utils.DisplayUtil
import com.amir.common.utils.ImageHelper
import com.amir.common.weight.DuplicateClickProxy
import com.help10000.rms.R
import com.lxj.xpopup.impl.FullScreenPopupView
import kotlinx.android.synthetic.main.dialog_view_big_image.view.*

class ViewBigImageDialog(context: Context, private var photoUrl: String) :
    FullScreenPopupView(context) {


    override fun getPopupHeight(): Int {
        return DisplayUtil.getDensityHeight(context)
    }

    override fun getPopupWidth(): Int {
        return DisplayUtil.getDensityWdith(context)
    }


    override fun getImplLayoutId(): Int {
        return R.layout.dialog_view_big_image

    }


    override fun onCreate() {
        super.onCreate()
        ImageHelper.displayImage(context, photoUrl, thumbImageView)
        thumbImageView.setOnClickListener(DuplicateClickProxy {
            dialog.dismiss()
        })
    }

}